<div class="classic-popup-main" id="formPayment">
	<div class="classic-popup-title">
		<div class="fl">
			<?= lang('input_personal_info') ?>
		</div>
		<div class="c">
		</div>
	</div>
	<div class="classic-popup-content">
		<div style="padding:15px" class="content">
			<div class="reg_cart_form">
				<form id="cartRegisterForm" name="cartRegisterForm">
					<input type="hidden" name="product_id">
					<div class="cartNewForm">
						<div class="cError">
							<div style="display:none;width: 300px; color:red; margin: 5px auto 15px; padding:10px; background:rgb(255, 249, 215); border: 1px solid rgb(226, 200, 34); text-align: center; font-size: 15px;" class="my_msg">							
							</div>
						</div>
						<div class="infoUser">
							<div class="text_tit">
								<?= lang('customer_info') ?>
							</div>
							<div style="padding-left:35px">
								<table cellspacing="0" cellpadding="3" border="0">
									<tbody>
										<tr>
											<td width="85" class="bold">
												<?= lang('fullname') ?>:</td>
											<td>
												<input type="text" name="fullname" id="cart_fullname">
											</td>
										</tr>
										<tr>
											<td class="bold">
												<?= lang('mobile') ?>:</td>
											<td>
												<input type="text"  maxlength="20" name="mobile">
											</td>
										</tr>
										<tr>
											<td class="bold">
												<?= lang('email') ?>:</td>
											<td>
												<input type="text" name="email" id="cart_email">
											</td>
										</tr>
										<tr>
											<td class="bold">
												<?= lang('captcha') ?>:</td>
											<td>
												<input type="text" name="captcha" style="width: 60px">&nbsp;<img style="vertical-align: middle" src="<?= url_create('site', 'captcha', 'index') ?>" alt="captcha" title="<?= lang('captcha') ?>" >
											</td>
										</tr>
									</tbody>
								</table>
							</div>
						</div>
						<div class="infoAddress mTop20">
							<div class="text_tit">
								<?= lang('delivery_address') ?>:</div>
							<div style="padding-left:35px">
								<table cellspacing="0" cellpadding="3" border="0">
									<tbody>
										<tr>
											<td width="85" class="bold">
												<?= lang('address') ?>:</td>
											<td>
												<input type="text" style="width:445px" name="address" id="cart_address">
											</td>
										</tr>
										<tr style="display: none;">
											<td id="wardTitle" class="bold">
												Xã/Phường:</td>
											<td>
												<select name="card_newWard" id="cart_newWard">
												</select>
											</td>
										</tr>
									</tbody>
								</table>
							</div>
						</div>
						<div class="c">
						</div>
					</div>
				</form>
				<div class="mTop10">
					<a id="fr" class="blueButton mLeft10 payment_next"href="javascript:void(0)">
						<span>
							<span>
								<?= lang('payment_next') ?>
							</span>
						</span>
					</a>
					<a id="fr" class="blueButton cancelButton" href="javascript:void(0)">
						<span>
							<span>
								<?= lang('payment_back') ?>
							</span>
						</span>
					</a>
					<div class="c">
					</div>
					<script>
						$('.payment_next').click(function(){
							$('#cartRegisterForm').submit();
						})
						$('#cartRegisterForm').submit(function(){
							$.ajax({
								url: '<?= url_create('site', 'order', 'payment') ?>',
								type: 'post',
								dataType: 'json',
								data: $('#cartRegisterForm').serialize(),
								success: function(o){
									if(o.state=='success'){
										message_box(o.message);
									}else{
										var str='';
										for(var i in o.errors){
											if(o.errors[i]!=''){
												str+=o.errors[i];
												$('#cartRegisterForm [name="'+i+'"]').addClass('error');
											}
											else{
												$('#cartRegisterForm [name="'+i+'"]').removeClass('error')
											}
										}
										$('#cartRegisterForm .cError div').html(str);
										$('#cartRegisterForm .cError div').css({display: 'block'})
										$.colorbox.resize();
									}
								}
							});
							return false;
						})
					</script>
				</div>
				<div class="c">
				</div>
			</div>
		</div>
	</div>
</div>

<div class="classic-popup-main" id="messageBox">
	<script>
		function message_box(str,title)
		{
			$('#messageBox .box-gradien').html(str);
			if(typeof(title)!='undefined') title = '<?=lang('site_message')?>';
			$('#messageBox .fl').html(title);
			open_popup('messageBox');
		}
	</script>
	<div class="classic-popup-title">
		<div class="fl"><?=lang('site_message')?></div>
		<div class="c"></div>
	</div>
	<div class="classic-popup-content">
		<div style="padding:20px" class="content">
			<div style="padding:20px 10px;width:435px;overflow:hidden" class="box-gradien">
				
			</div>
		</div>
	</div>
</div>